import { defineStore } from 'pinia';

/**
 * 用户按钮信息
 * @methods useAuthBtn 设置用户按钮信息
 */
export const useAuthBtn = defineStore('authBtn', {
	state: (): any => ({
		authBtnList: ['admin'], // 用户按钮信息
	}),
	actions: {
		async setAuthBtn(view: any) {
			this.authBtnList = [];
			if (view.length) {
				view.map((v: any) => {
					this.authBtnList.push(v.code);
				});
			}
		},
	},
});
